package teacher.action.excel;

import java.util.List;

import teacher.bean.Paper;
import teacher.bean.Teacher;
import teacher.service.laohe.ListShow;
import teacher.service.PullPaperToExcel;

import com.opensymphony.xwork2.ActionContext;

public class excelPap {
	private int flag;
	private List<Paper> papers;
	public int getFlag() {
		return flag;
	}
	public void setFlag(int flag) {
		this.flag = flag;
	}
	public List<Paper> getPapers() {
		return papers;
	}
	public void setPapers(List<Paper> papers) {
		this.papers = papers;
	}
	public String execute()
	{
		Paper paper=new Paper();
		Paper paper1=new Paper();
		paper.setType(0);
		paper1.setType(1);
		Teacher tea=(Teacher)ActionContext.getContext().getSession().get("teacher");
		if(flag==0)
		{
			paper.setJclass(0);
			this.setPapers(new ListShow().getPaperByUser(paper, null, tea));
			new PullPaperToExcel().paperExcel2(this.getPapers());
		}
		 if(flag==1)
		{
			 paper.setJclass(1);
			this.setPapers(new ListShow().getPaperByUser(paper, null, tea));	
			new PullPaperToExcel().paperExcel2(this.getPapers());
		}
		 if(flag==2)
		{
			 paper.setJclass(2);
			this.setPapers(new ListShow().getPaperByUser(paper, null, tea));
			new PullPaperToExcel().paperExcel2(this.getPapers());
		}
		 if(flag==3)
			{
			 paper.setJclass(3);
				this.setPapers(new ListShow().getPaperByUser(paper, null, tea));
				new PullPaperToExcel().paperExcel2(this.getPapers());
			}
		 if(flag==4)
			{
				paper1.setMeetClass(0);
				this.setPapers(new ListShow().getPaperByUser(paper1, null, tea));
				new PullPaperToExcel().paperExcel2(this.getPapers());
			}
			 
		 if(flag==5)
			{
			 	paper1.setMeetClass(1);
				this.setPapers(new ListShow().getPaperByUser(paper1, null, tea));
				new PullPaperToExcel().paperExcel2(this.getPapers());
			}
			 
		
		 if(flag==6)
			{
			 paper1.setMeetClass(2);
				this.setPapers(new ListShow().getPaperByUser(paper1, null, tea));
				new PullPaperToExcel().paperExcel2(this.getPapers());
			}
			 
		
		return "succ";
	}
}